{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "4f154f62-e82a-4e15-b378-7985e21ca585",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2022-01-24T18:19:10.782236Z",
     "iopub.status.busy": "2022-01-24T18:19:10.781943Z",
     "iopub.status.idle": "2022-01-24T18:19:10.866548Z",
     "shell.execute_reply": "2022-01-24T18:19:10.865978Z",
     "shell.execute_reply.started": "2022-01-24T18:19:10.782163Z"
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "8e07ad91-870c-4c2d-9688-f66a7b5397b8",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2022-01-24T18:19:13.322175Z",
     "iopub.status.busy": "2022-01-24T18:19:13.321858Z",
     "iopub.status.idle": "2022-01-24T18:19:13.659504Z",
     "shell.execute_reply": "2022-01-24T18:19:13.659052Z",
     "shell.execute_reply.started": "2022-01-24T18:19:13.322146Z"
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "# 测试原生python的效率\n",
    "a = []\n",
    "for x in range(1000000):\n",
    "    a.append(x ** 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "9fe25db0-e2ed-4a24-b6aa-b4a65be85252",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2022-01-24T18:20:35.411022Z",
     "iopub.status.busy": "2022-01-24T18:20:35.410729Z",
     "iopub.status.idle": "2022-01-24T18:20:35.423591Z",
     "shell.execute_reply": "2022-01-24T18:20:35.422681Z",
     "shell.execute_reply.started": "2022-01-24T18:20:35.410990Z"
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "# 测试Numpy的效率\n",
    "b = np.arange(1000000)**2"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
